<template>
  <div class="global-footer">
    <el-container>
      <div class="footer-content">
        <!-- 主要内容区域 -->
        <div class="footer-main">
          <div class="footer-section">
            <div class="footer-brand">
              <img src="../assets/electron.svg" alt="Logo" class="footer-logo" />
              <span class="footer-title">Mixed Project</span>
            </div>
            <p class="footer-description">
              一个现代化的全栈项目，基于Vue3 + Spring Boot构建
            </p>
          </div>

          <div class="footer-section">
            <h4 class="section-title">快速链接</h4>
            <ul class="footer-links">
              <li><router-link to="/" class="footer-link">首页</router-link></li>
              <li><router-link to="/about" class="footer-link">关于我们</router-link></li>
              <li><router-link to="/contact" class="footer-link">联系我们</router-link></li>
            </ul>
          </div>

          <div class="footer-section">
            <h4 class="section-title">技术栈</h4>
            <ul class="footer-links">
              <li><span class="footer-link">Vue 3</span></li>
              <li><span class="footer-link">Element Plus</span></li>
              <li><span class="footer-link">Spring Boot</span></li>
              <li><span class="footer-link">PostgreSQL</span></li>
            </ul>
          </div>

          <div class="footer-section">
            <h4 class="section-title">联系方式</h4>
            <div class="contact-info">
              <p class="contact-item">
                <el-icon><Message /></el-icon>
                <span>support@mixedproject.com</span>
              </p>
              <p class="contact-item">
                <el-icon><Phone /></el-icon>
                <span>+86 123-4567-8900</span>
              </p>
            </div>
          </div>
        </div>

        <!-- 版权信息 -->
        <div class="footer-bottom">
          <div class="copyright">
            <p>&copy; {{ currentYear }} Mixed Project. All rights reserved.</p>
          </div>
          <div class="footer-links-bottom">
            <a href="#" class="footer-link-bottom">隐私政策</a>
            <span class="divider">|</span>
            <a href="#" class="footer-link-bottom">服务条款</a>
            <span class="divider">|</span>
            <a href="#" class="footer-link-bottom">网站地图</a>
          </div>
        </div>
      </div>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { Message, Phone } from '@element-plus/icons-vue'

// 当前年份
const currentYear = computed(() => {
  return new Date().getFullYear()
})
</script>

<style scoped>
.global-footer {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 40px 0 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.footer-logo {
  height: 32px;
  width: 32px;
  object-fit: contain;
}

.footer-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.footer-description {
  color: #bdc3c7;
  line-height: 1.6;
  margin: 0;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 16px 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-link {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #3498db;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #bdc3c7;
}

.contact-item .el-icon {
  color: #3498db;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid #34495e;
}

.copyright {
  margin: 0;
}

.copyright p {
  margin: 0;
  color: #bdc3c7;
  font-size: 14px;
}

.footer-links-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link-bottom {
  color: #bdc3c7;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-link-bottom:hover {
  color: #3498db;
}

.divider {
  color: #7f8c8d;
  font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .footer-content {
    padding: 0 16px;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .footer-content {
    padding: 0 12px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-links-bottom {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .global-footer {
    padding: 30px 0 0;
  }

  .footer-main {
    gap: 20px;
    margin-bottom: 24px;
  }

  .footer-brand {
    gap: 8px;
  }

  .footer-title {
    font-size: 18px;
  }

  .footer-logo {
    height: 28px;
    width: 28px;
  }
}
</style>
